<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_auth('order');

$id = abs(intval($_GET['id']));

$order = Table::Fetch('order', $id);


if($order['is_pin'] == 1)
{
	//pin_order_list
	$pin_order_list = DB::LimitQuery('pin_order_list', array(
		'condition' => array('order_id'=>$order['id']),
		'one' => true,
	));
	$pin_order =  DB::LimitQuery('pin_order', array(
		'condition' => array('id'=>$pin_order_list['pin_id']),
		'one' => true,
	));
	$order['pin_info'] = $pin_order;
}

$team = Table::Fetch('team', $order['team_id']);


include template('manage_order_print');